import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

class Prop1(QWidget):
    def __init__(self):
        super(Prop1, self).__init__()
        self.setWindowTitle('buttonGroup')

        r11=QRadioButton('11',self)
        r12=QRadioButton('12',self)
        r21=QRadioButton('21',self)
        r22=QRadioButton('22',self)

        l1=QVBoxLayout()
        l1.addWidget(r11)
        l1.addWidget(r12)
        w1=QWidget()
        w1.setLayout(l1)

        l2=QVBoxLayout()
        l2.addWidget(r21)
        l2.addWidget(r22)
        w2=QWidget()
        w2.setLayout(l2)
        group=QButtonGroup(self)
        group.addButton(r11)
        group.addButton(r12)
        group.addButton(r21)
        group.addButton(r22)

        main_layout=QHBoxLayout()
        main_layout.addWidget(w1)
        main_layout.addWidget(w2)




        self.setLayout(main_layout)





if __name__ == '__main__':
    app = QApplication(sys.argv)
    myshow = Prop1()
    myshow.show()
    sys.exit(app.exec_())
